package tree;

import java.util.ArrayList;
/**
 * holds all tree nodes in their proper array type for faster access
 *
 */
public class TreeNodesManager {
	private ArrayList<Node> allConstantsInTree;
	private ArrayList<Node> allNumericFunctionsInTree; 		 //like avg,max,min
	private ArrayList<Node> allBooleansFunctionInTree; 		 //like OR, AND, NOT
	private ArrayList<Node> allBooleanNumericFunctionInTree; //like > , < , =
	private ArrayList<Node> allNodesInTree;
	
	public TreeNodesManager() {
		this.allBooleanNumericFunctionInTree=new ArrayList<Node>();
		this.allNumericFunctionsInTree=new ArrayList<Node>();
		this.allBooleansFunctionInTree=new ArrayList<Node>();
		this.allConstantsInTree=new ArrayList<Node>();
		this.allNodesInTree=new ArrayList<Node>();
		
	}
	//--getters--//
	public ArrayList<Node> getAllBooleanNumericFunctionInTree() {
		return allBooleanNumericFunctionInTree;
	}
	public ArrayList<Node> getAllBooleansFunctionInTree() {
		return allBooleansFunctionInTree;
	}
	public ArrayList<Node> getAllConstantsInTree() {
		return allConstantsInTree;
	}
	public ArrayList<Node> getAllNumericFunctionsInTree() {
		return allNumericFunctionsInTree;
	}
	public ArrayList<Node> getAllNodesInTree() {
		return allNodesInTree;
	}
	
	public void addBooleanNode(Node node){
		allBooleansFunctionInTree.add(node);
		allNodesInTree.add(node);
	}
	public void addBooleanNumericNode(Node node){
		allBooleanNumericFunctionInTree.add(node);
		allNodesInTree.add(node);
	}
	public void addNumericFunctionNode(Node node){
		allNumericFunctionsInTree.add(node);
		allNodesInTree.add(node);
	}
	public void addConstantNode(Node node){
		allConstantsInTree.add(node);
		allNodesInTree.add(node);
	}
	public void addNode(Node node) {
		allNodesInTree.add(node);
	}
	
	//--------------Functions needed for XML file----------------------------------------//
	public void setAllBooleanNumericFunctionInTree(
			ArrayList<Node> allBooleanNumericFunctionInTree) {
		this.allBooleanNumericFunctionInTree = allBooleanNumericFunctionInTree;
	}
	public void setAllBooleansFunctionInTree(
			ArrayList<Node> allBooleansFunctionInTree) {
		this.allBooleansFunctionInTree = allBooleansFunctionInTree;
	}
	public void setAllConstantsInTree(ArrayList<Node> allConstantsInTree) {
		this.allConstantsInTree = allConstantsInTree;
	}
	public void setAllNodesInTree(ArrayList<Node> allNodesInTree) {
		this.allNodesInTree = allNodesInTree;
	}
	public void setAllNumericFunctionsInTree(
			ArrayList<Node> allNumericFunctionsInTree) {
		this.allNumericFunctionsInTree = allNumericFunctionsInTree;
	}
	//------------------------------------------------------------------------------//
	
	
}
